package com.facebook.games.fa.model
{
	import mx.collections.ArrayCollection;
	
	/**
	 * Jogador
	 * @author Diego Maehler <dmaehler@gmail.com>
	 */
	[Bindable]
	public class Player
	{
		
		public var user : User;
		
		public var principalPack : Pack;
		
		public var aditionalPack : Pack;
		
		/**
		 * 
		 */
		public function Player (user : User = null, pack : Pack = null)
		{
			this.user = user;
			this.principalPack = pack;
		}
		
		/**
		 * Transfere o baralho adicional para o principal, para o jogar
		 * continuar seu jogo
		 */
		public function transferPacks () : void
		{
			if (this.aditionalPack != null) {
				this.aditionalPack.shuffle();
				this.principalPack.cards = new ArrayCollection(this.aditionalPack.cards.toArray());
			}
		}
		
	}
}